# -*- coding: utf-8 -*-

from django.db import models
from sm.models import CorpInfo

# Create your models here.

class PersonInfo(models.Model):
    person_id = models.CharField(max_length=20) #ID
    scbh = models.CharField(max_length=11,primary_key=True) #内部编号 
    name = models.CharField(max_length=20) #姓名
    sex = models.CharField(max_length=2) #性别
    folk = models.CharField(max_length=2) #民族
    person_stat = models.CharField(max_length=2) #人员状态
    birth_date = models.DateField() #出生日期
    work_date = models.DateField() #工作日期
    tire_date = models.DateField(blank=True) #退休日期 
    corp = models.ForeignKey(CorpInfo,on_delete=models.CASCADE) #单位编码(外键)
    person_salary_yl = models.DecimalField(max_digits=10,decimal_places=2) # 个人养老基数
    person_salary_nj = models.DecimalField(max_digits=10,decimal_places=2)#个人年金基数
    flag_yl = models.BooleanField() #养老参保标志
    flag_gs = models.BooleanField()
    flag_sy = models.BooleanField()
    flag_nj = models.BooleanField()
    flag_yb = models.BooleanField()
	
    aac001_yl = models.CharField(max_length=20,blank=True)
    aac001_gs = models.CharField(max_length=20,blank=True)
    aac001_yb = models.CharField(max_length=20,blank=True)

    def __str__(self):
        strings = self.name +", "+self.scbh
        return strings
	
	


	

    

    
    
	

	
	
	
